<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>

<body>
    <div id="app-3">
        <!-- 条件渲染 -->
        <!-- 如果seen为true则渲染p标签 -->
        <p v-if="seen">现在你看到我了</p>
    </div>

    <div id="app-4">
        <ol>
            <!-- 列表渲染 -->
            <!-- 为todos数组中的每个item渲染一个li -->
            <li v-for="todo in todos">
                {{ todo.text }}
            </li>
        </ol>
    </div>

    <script>
        var app3 = new Vue({
            el: '#app-3',
            data: {
                seen: true
            }
        })
    </script>

    <script>
        new Vue({
            el: '#app-4',
            data: {
                todos: [
                    { text: '学习 JavaScript' },
                    { text: '学习 Vue' },
                    { text: '整个牛项目' }
                ]
            }
        })
    </script>
</body>

</html>